
	//线路送机出发地弹出层事件
	function toLocationStartPop(){
		if($('#away-air1-e-name').val()=='送机城市名'){
			$('#away-air1-e-name').val('');
		}
		$("#away-air-seat").hide();
		initHotCityHide();	
		searchCommon('away-air1-e-name','3');
	}
	
	//线路送机上车地弹出层事件
	function toLocationEndPop(){
		if($('#away-air-b-name').val()=='上车地'){
			$('#away-air-b-name').val('');
		}
		$("#away-air-seat").hide();
		$("#air-away-seat").hide();
		initHotCityHide();
		var checkval =  $("input[name='airPortRadio']:visible:checked").val();
		if(checkval != "" && checkval != null && checkval != "undefined"){
			var arr = checkval.split("_");
		    var url = "/frontend/vehicle/vehicle!loadAutoCity.action?queryVo.flag=20&queryVo.endLocationId="+arr[0];
		    $("#r-text40").load(encodeURI(url));
			searchCommon('away-air-b-name','40');
		}else{
		  return;
		}
	}
	
	//线路接机出发地弹出层事件
	function pickLocationStartPop(){
		if($('#air-away1-b-name').val()=='接机城市名'){
			$('#air-away1-b-name').val('');
		}
		$("#air-away-seat").hide();
		initHotCityHide();
		searchCommon('air-away1-b-name','3');
	}
	
	//线路接机出发地弹出层事件
	function pickLocationEndPop(){
		if($('#air-away-e-name').val()=='送达地'){
			$('#air-away-e-name').val('');
		}
		$("#air-away-seat").hide();
		initHotCityHide();
		var checkval =  $("input[name='airPortRadio']:visible:checked").val();
		if(checkval != "" && checkval != null && checkval != "undefined"){
			var arr = checkval.split("_");
		    var url = "/frontend/vehicle/vehicle!loadAutoCity.action?queryVo.flag=10&queryVo.startLocationId="+arr[0];
		    $("#r-text30").load(encodeURI(url));
			searchCommon('air-away-e-name','30');
		}else{
		  return;
		}
	}
	
	//城际出发地弹出层事件
	function cityLocationStartPop(){
		if($('#rount-f-name').val()=='城市名'){
			$('#rount-f-name').val('');
		}
		$("#a-b-seat").hide();
		initHotCityHide();
		searchCommon('rount-f-name','2');
	}
	
	//城际结束地弹出层事件
	function cityLocationEndPop(){
		if($('#rount-t-name').val()=='城市名'){
			$('#rount-t-name').val('');
		}
		$("#a-b-seat").hide();
		initHotCityHide();	
		if($("#rount-f-id").val() != null){
		    var url = "/frontend/vehicle/vehicle!loadAutoPointForIndex.action?queryVo.flag=30&queryVo.startLocationId="+$("#rount-f-id").val();
		    $("#r-text30").load(encodeURI(url));
			searchCommon('rount-t-name','30');		
		}
	}
	
		//初始化屏蔽所有弹出层
	function initHotCityHide(){
	    //客栈目的地搜索
		//$("#hot-input-text1").hide();
		//自驾,日租,城际 对应城市
		$("#hot-input-text2").hide();
		//自驾异地后加载城市
		$("#hot-input-text20").hide();
		//接送对应城市
		$("#hot-input-text3").hide();
		//接机后加载城市
		$("#hot-input-text30").hide();
		//送机后加载城市
		$("#hot-input-text40").hide();
		//热门目的地搜索
		$("#hot-input-text7").hide();
	}
	
	//弹出层的显示
	function searchCommon(spanId,hotId){
		
		$input = $("#"+spanId);
		$suggest = $("#hot-input-text"+hotId);
		$suggest.css("position","absolute");
		$suggest.css("margin","0 0 0 0");
		var offset = $input.offset();
		var ch = $(window).height();
		var top = offset.top+$input.height()+5;
		if($suggest.height()+top>ch){
			// top = offset.top-$suggest.height()-5;
		}
		$suggest.css({"left":offset.left,"top":top});
		$suggest.show();
		
		$hidden = $("#hidden-input-text"+hotId);
		$hidden.val(spanId);
		return false;
	}	
	
	//弹出层点击事件
	function bundInputText(hiddenId,cityName,cityId){
	    var spanId = "";
	    if($("#"+hiddenId)[0]){
	        spanId = $("#"+hiddenId).val();
	    }
	    var locId = spanId.replace("name","id");
	    if($("#"+spanId)[0]){
	        $("#"+spanId).val(cityName);
	    }
	    if($("#"+locId)[0]){
	        $("#"+locId).val(cityId);
	    }
	    var inputId = hiddenId.replace("hidden","hot");
	    if($("#"+inputId)[0]){	    
	        $("#"+inputId).hide();
	        if(inputId=='hot-input-text2'){
	        	 $('#loc-seat').show();
	        	 $('#with-seat').show();
	        	 $('#a-b-seat').show();
	        }else if(inputId=='hot-input-text3'){
	        	 $('#away-air-seat').show();
	        	 $('#air-away-seat').show();
	        }else if(inputId=='hot-input-text40'){
	        	 $('#away-air-seat').show();
	        	 $('#air-away-seat').show();
	        }
	        
	        
	    }	    
	    if(spanId=='no-l-name'){
	       
	    }else if(spanId=='no-l-carry-name'){
	       
	    }else if(spanId=='with-l-name'){
	        
	    }else if(spanId=='rount-f-name'){
	        
	    }else if(spanId=='air-away1-b-name'){
	        loadAirPort3(cityId,cityName);
	        
	    }else if(spanId=='away-air1-e-name'){
	        loadAirPort4(cityId,cityName);
	        
	    }
	}
		//接机加载飞机场
	function loadAirPort3(id,name){
	    var locationId = id;
	    var locationName = name;
		var url = "/frontend/vehicle/vehicle!loadAirPortSpanForIndex.action?queryVo.locationName=" + locationName + "&queryVo.locationId=" + locationId + "&queryVo.type=0&s=" + new Date().getTime();
		
		$.get(encodeURI(url),function(data){
			$("#away-air-port").html($.trim(data));
		});
	}
	
	function loadAirPort4(id,name){
	    var locationId = id;
	    var locationName = name;
		var url = "/frontend/vehicle/vehicle!loadAirPortSpanForIndex.action?queryVo.locationName=" + locationName + "&queryVo.locationId=" + locationId + "&queryVo.type=1&s=" + new Date().getTime();
		$.get(encodeURI(url),function(data){
			$("#air-away-port").html($.trim(data));
		});
	}